#!/usr/bin/env python
# -*- coding: utf-8 -*-

from sqlalchemy import Boolean, Column, Integer, String, text, TIMESTAMP, BigInteger
from sqlalchemy.orm import relationship

from app.db.base_class import Base



class StrategyCode(Base):
    __tablename__ = 'tb_strategy_code'

    id = Column(BigInteger, primary_key=True)
    strategyId = Column('strategy_id', BigInteger)
    code = Column(String(2048))
    params = Column(String(256))
    version = Column(Integer)
    precision = Column(Integer)
    drawType = Column('draw_type', Integer)
    state = Column(String(2))
    createdDate = Column('created_date', TIMESTAMP, server_default=text('CURRENT_TIMESTAMP'))
    updatedDate = Column('updated_date', TIMESTAMP,
                         server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'))

    # def __getitem__(self, item):
    #     return self.__getattribute__(item)
